#include "StdAfx.h"
#include "WeekPlanModel.h"


CWeekPlanModel::CWeekPlanModel(void)
{
	m_id = 0;
	m_userID = 0;
	m_week = 0;
	m_planSqjs = 0;
	m_planFkjs = 0;
	m_planFkje = 0;
	m_planJhcs = 0;
	m_planSqkh = 0;
	m_planTm = 0;

	m_weekMeetCnt = 0;
	m_weekSignedCnt = 0;
	m_weekExtendLoanCnt = 0;
}

CWeekPlanModel::~CWeekPlanModel(void)
{
}

void CWeekPlanModel::parseFromJson(Json::Value& jsonData)
{
	if (!jsonData["userID"].isNull()) 
	{
		this->m_userID = jsonData["userID"].asInt();
	}
	if (!jsonData["week"].isNull()) 
	{
		this->m_week = jsonData["week"].asInt();
	}
	if (!jsonData["planSqjs"].isNull()) 
	{
		this->m_planSqjs = jsonData["planSqjs"].asInt();
	}
	if (!jsonData["planFkjs"].isNull()) 
	{
		this->m_planFkjs = jsonData["planFkjs"].asInt();
	}
	if (!jsonData["planFkje"].isNull()) 
	{
		this->m_planFkje = jsonData["planFkje"].asInt();
	}
	if (!jsonData["planJhcs"].isNull()) 
	{
		this->m_planJhcs = jsonData["planJhcs"].asInt();
	}
	if (!jsonData["planSqkh"].isNull()) 
	{
		this->m_planSqkh = jsonData["planSqkh"].asInt();
	}
	if (!jsonData["weekMeetCnt"].isNull()) 
	{
		this->m_weekMeetCnt = jsonData["weekMeetCnt"].asInt();
	}
	if (!jsonData["weekSignedCnt"].isNull()) 
	{
		this->m_weekSignedCnt = jsonData["weekSignedCnt"].asInt();
	}
	if (!jsonData["weekExtendLoanCnt"].isNull()) 
	{
		this->m_weekExtendLoanCnt = jsonData["weekExtendLoanCnt"].asInt();
	}
	if (!jsonData["keyPointIDs"].isNull()) 
	{
		this->m_keyPointConsumerIDs = jsonData["keyPointIDs"].asCString();
		CUtils::splitStringToIntArray(m_keyPointConsumerIDs, m_vtKeyPointConsumerID);
	}
	if (!jsonData["signedConuserIDs"].isNull())
	{
		this->m_signedConuserIDs = jsonData["signedConuserIDs"].asCString();
		CUtils::splitStringToIntArray(m_signedConuserIDs, m_vtSignedConuserID);
	}
	if (!jsonData["extendConuserIDs"].isNull())
	{
		m_extendConuserIDs = jsonData["extendConuserIDs"].asCString();
		CUtils::splitStringToIntArray(m_extendConuserIDs, m_vtExtendConuserID);
	}
	if (!jsonData["planTm"].isNull()) 
	{
		this->m_planTm = jsonData["planTm"].asInt64();
	}
}
